#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Project: spd-sxmcc
"""
@author: lyndon
@time Created on 2018/9/27 11:18
@desc
"""
from __future__ import print_function

import cx_Oracle
import os

os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.ZHS16GBK'
# Connect as user "hr" with password "welcome" to the "orclpdb1" service running on this computer.
connection = cx_Oracle.connect("readhscmp", "readhscmp", "192.168.1.198:1521/cmp")

cursor = connection.cursor()
cursor.execute("""
        SELECT RPTSQL
        FROM TRPTSCRIPT
        ORDER BY SCRIPTCODE""",
               )
for rptsql in cursor:
    print("Values:", rptsql)
